
Use Tunga

GO
--Insert
CREATE PROC insertTableType
	@[typename] nvarchar(100),
	@[capacity] int,
	@[position] bit,
	@[price] float,
	@[picture] nvarchar(500),
	@[descr] nvarchar(500),
	@[status] bit default(0)
AS
INSERT INTO  [TableType]([typename],[capacity],[position],[price],[picture],[descr],[status])
 VALUES(@[typename],@[capacity],@[position],@[price],@[picture],@[descr],@[status])

GO
--Update
CREATE PROC updateTableType
	@[id] int,
	@[typename] nvarchar(100),
	@[capacity] int,
	@[position] bit,
	@[price] float,
	@[picture] nvarchar(500),
	@[descr] nvarchar(500),
	@[status] bit default(0)
AS
UPDATE [TableType] SET	
	[typename] =@[typename],
	[capacity] =@[capacity],
	[position] =@[position],
	[price] =@[price],
	[picture] =@[picture],
	[descr] =@[descr]),
	[status] =@[status]
WHERE 	[id] =@[id]
GO
--Delete
CREATE PROC deleteTable
	@[id] int
AS
	DELETE FROM [TableType] WHERE [id]=@[id]
GO
--Get All TableType
CREATE PROC getAllTableType
AS
SELECT * from [TableType]
GO
--Get TableType By ID
CREATE PROC getTableTypeByID
	@[id] int
AS
SELECT * from [TableType] WHERE [id]=@[id]
GO


